<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/sys/Sys_Role.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/sys/Sys_Role.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Sys_Role",
        setup() {
            const table = ref({
                key: "RoleId",
                footer: "Foots",
                cnName: "角色管理",
                name: "Sys_Role",
                newTabEdit: false,
                url: "/Sys_Role/",
                sortName: "RoleId"
            });
            const editFormFields = ref({"RoleName":"","DatAuth":"","Enabled":"","Remarks":""});
            const editFormOptions = ref([[{"title":"角色名称","field":"RoleName"}],
                              [{"title":"数据授权","field":"DatAuth"}],
                              [{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"}],
                              [{"title":"备注","field":"Remarks"}]]);
            const searchFormFields = ref({"RoleName":"","Enabled":""});
            const searchFormOptions = ref([[{"title":"角色名称","field":"RoleName","type":"text"},{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"}]]);
            const columns = ref([{field:"RoleId",title:"角色ID",type:"bigint",width:90,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ParentId",title:"父阶ID",type:"bigint",bind:{ key:"tree_roles",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"RoleName",title:"角色名称",type:"string",link:true,width:90,showOverflowTooltip:true,align:"left"},
                       {field:"DeptId",title:"部门ID",type:"bigint",width:90,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"DeptName",title:"部门名",type:"string",width:90,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"DatAuth",title:"数据授权",type:"string",width:130,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"sbyte",bind:{ key:"enabled",data:[]},width:90,showOverflowTooltip:true,align:"left"},
                       {field:"OrderNo",title:"排序",type:"int",width:90,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:130,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:90,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:130,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:90,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建人ID",type:"bigint",width:120,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改人ID",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"DbServiceId",title:"服务数据库Id",type:"bigint",width:110,hidden:true,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
